package com.jmxcfc.blfsc.jiwei.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jmxcfc.blfsc.jiwei.entity.SmsNotifyRecord;

/**
 * <p>
 * 集微短信通知记录表 服务类
 * </p>
 *
 * @author pbs
 * @since 2024-06-23
 */
public interface ISmsNotifyRecordService extends IService<SmsNotifyRecord> {


    /**
     * 根据推送的事务Id判断是否已经推送过,避免重复接收
     * @param transactionId 对方的推送的事务Id
     * @return 返回 ture:不存在, false:存在
     */
    default boolean isNotExist(String transactionId){
        LambdaQueryWrapper<SmsNotifyRecord> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(SmsNotifyRecord::getTransactionId, transactionId);
        return  count(queryWrapper) <= 0;
    }
}
